package user.zc.file;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileOutputStream;

public class WriteFile implements OutputResource {
    private String filePath  ;
    public WriteFile(String filePath){
        this.filePath = filePath;
    }
    @Override
    public void write(XSSFWorkbook xssfWorkbook) {
        try(FileOutputStream out = new FileOutputStream(filePath)){
            xssfWorkbook.write(out);
            out.flush();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
